package com.weiyun.notebook.Dao

import androidx.lifecycle.LiveData
import androidx.room.*
import com.weiyun.notebook.Entity.Note

@Dao
interface NoteDao {
    @Insert
    fun insert(note: Note)
    @Update
    fun update(note: Note)
    @Query("select * from Note")
    fun getAllNotes(): LiveData<List<Note>>
    @Query("select * from Note where title like :param or content like :param")
    fun getSpeNotes(param: String): LiveData<List<Note>>
    @Delete
    fun delete(note: Note)
//    @Query("delete from note where id = :id")
//    fun deleteUserByLastName(id: Int): Int
}